<?php
/**
 * Inicializacia prostredia
 * @author Tomas Srna
 * @package bakalarka
 */

define('DS', DIRECTORY_SEPARATOR);
/**
 * Koren aplikacie - Filesystem
 * @var string
 */
define('APPROOT', realpath(dirname(__FILE__)) . DS);
/**
 * Zakladne URL
 * @var string
 */
define('APPBASE', getenv('APPBASE'));
/**
 * Nazov aplikacie
 * @var string
 */
define('APPNAME', getenv('APPNAME'));
define('DEBUG', getenv('DEBUG'));

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . APPROOT);

header("Content-type: text/html;charset=utf-8");

if(getenv('DEBUG'))
{
	ini_set('display_errors', 'on');
	error_reporting(E_ALL);
}
else
	ini_set('display_errors', 'off');
	
session_set_cookie_params(NULL, APPBASE);
session_name("session_id");

require_once('autoload.php');
require_once('config.php');

if(!class_exists("Config", false))
	die("<strong>Fatal error:</strong> Configuration does not exist.");

date_default_timezone_set(Config::$timezone);


